{"ast":null,"code":"import useMemo from \"rc-util/es/hooks/useMemo\";\nimport isEqual from \"rc-util/es/isEqual\";\nimport { defaultConfig } from '../../theme/internal';\nexport default function useTheme(theme, parentTheme) {\n  const themeConfig = theme || {};\n  const parentThemeConfig = themeConfig.inherit === false || !parentTheme ? defaultConfig : parentTheme;\n  const mergedTheme = useMemo(() => {\n    if (!theme) {\n      return parentTheme;\n    }\n    // Override\n    const mergedComponents = Object.assign({}, parentThemeConfig.components);\n    Object.keys(theme.components || {}).forEach(componentName => {\n      mergedComponents[componentName] = Object.assign(Object.assign({}, mergedComponents[componentName]), theme.components[componentName]);\n    });\n    // Base token\n    return Object.assign(Object.assign(Object.assign({}, parentThemeConfig), themeConfig), {\n      token: Object.assign(Object.assign({}, parentThemeConfig.token), themeConfig.token),\n      components: mergedComponents\n    });\n  }, [themeConfig, parentThemeConfig], (prev, next) => prev.some((prevTheme, index) => {\n    const nextTheme = next[index];\n    return !isEqual(prevTheme, nextTheme, true);\n  }));\n  return mergedTheme;\n}","map":{"version":3,"names":["useMemo","isEqual","defaultConfig","useTheme","theme","parentTheme","themeConfig","parentThemeConfig","inherit","mergedTheme","mergedComponents","Object","assign","components","keys","forEach","componentName","token","prev","next","some","prevTheme","index","nextTheme"],"sources":["/data/messenger.client/node_modules/antd/es/config-provider/hooks/useTheme.js"],"sourcesContent":["import useMemo from \"rc-util/es/hooks/useMemo\";\nimport isEqual from \"rc-util/es/isEqual\";\nimport { defaultConfig } from '../../theme/internal';\nexport default function useTheme(theme, parentTheme) {\n  const themeConfig = theme || {};\n  const parentThemeConfig = themeConfig.inherit === false || !parentTheme ? defaultConfig : parentTheme;\n  const mergedTheme = useMemo(() => {\n    if (!theme) {\n      return parentTheme;\n    }\n    // Override\n    const mergedComponents = Object.assign({}, parentThemeConfig.components);\n    Object.keys(theme.components || {}).forEach(componentName => {\n      mergedComponents[componentName] = Object.assign(Object.assign({}, mergedComponents[componentName]), theme.components[componentName]);\n    });\n    // Base token\n    return Object.assign(Object.assign(Object.assign({}, parentThemeConfig), themeConfig), {\n      token: Object.assign(Object.assign({}, parentThemeConfig.token), themeConfig.token),\n      components: mergedComponents\n    });\n  }, [themeConfig, parentThemeConfig], (prev, next) => prev.some((prevTheme, index) => {\n    const nextTheme = next[index];\n    return !isEqual(prevTheme, nextTheme, true);\n  }));\n  return mergedTheme;\n}"],"mappings":"AAAA,OAAOA,OAAO,MAAM,0BAA0B;AAC9C,OAAOC,OAAO,MAAM,oBAAoB;AACxC,SAASC,aAAa,QAAQ,sBAAsB;AACpD,eAAe,SAASC,QAAQ,CAACC,KAAK,EAAEC,WAAW,EAAE;EACnD,MAAMC,WAAW,GAAGF,KAAK,IAAI,CAAC,CAAC;EAC/B,MAAMG,iBAAiB,GAAGD,WAAW,CAACE,OAAO,KAAK,KAAK,IAAI,CAACH,WAAW,GAAGH,aAAa,GAAGG,WAAW;EACrG,MAAMI,WAAW,GAAGT,OAAO,CAAC,MAAM;IAChC,IAAI,CAACI,KAAK,EAAE;MACV,OAAOC,WAAW;IACpB;IACA;IACA,MAAMK,gBAAgB,GAAGC,MAAM,CAACC,MAAM,CAAC,CAAC,CAAC,EAAEL,iBAAiB,CAACM,UAAU,CAAC;IACxEF,MAAM,CAACG,IAAI,CAACV,KAAK,CAACS,UAAU,IAAI,CAAC,CAAC,CAAC,CAACE,OAAO,CAACC,aAAa,IAAI;MAC3DN,gBAAgB,CAACM,aAAa,CAAC,GAAGL,MAAM,CAACC,MAAM,CAACD,MAAM,CAACC,MAAM,CAAC,CAAC,CAAC,EAAEF,gBAAgB,CAACM,aAAa,CAAC,CAAC,EAAEZ,KAAK,CAACS,UAAU,CAACG,aAAa,CAAC,CAAC;IACtI,CAAC,CAAC;IACF;IACA,OAAOL,MAAM,CAACC,MAAM,CAACD,MAAM,CAACC,MAAM,CAACD,MAAM,CAACC,MAAM,CAAC,CAAC,CAAC,EAAEL,iBAAiB,CAAC,EAAED,WAAW,CAAC,EAAE;MACrFW,KAAK,EAAEN,MAAM,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